package net.atomarrow.db.parser;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

import net.atomarrow.bean.Pager;
import net.atomarrow.db.parser.batch.BatchSqlHolder;
import net.atomarrow.domains.Domain;
/**
 * 解析器
 * @author Michael
 *
 */
public interface Parser {

    String getAddSql(String tableName, Domain domain);

    String getAddSql(Domain domain);

    String getSelectHql(Conditions conditions);

    String getDelHql(Conditions conditions);

    String getCountHql(Conditions conditions);

    String getMaxHql(Conditions conditions, String attribute);

    String getMaxDomainHql(Conditions conditions, String attribute);

    String getSumHql(Conditions conditions, String attribute);

    String getDistinctHql(Conditions conditions, String attribute);

    String getColumnHql(Conditions conditions, String attribute);

    String getMulColumnHql(Conditions conditions, String[] columns);

    String getModifyColumnHql(Conditions conditions, Serializable[] keyValues);

    String getModifyColumnHql(Conditions conditions, Map<String, Serializable> columns);

    String getUpdateSql(String tableName, Domain domain);

    String getColumnPagerSql(Conditions conditions, String attribute, Pager pager);

    String getSelectPagerSql(Conditions conditions, Pager pager);

    String getMulColumnPagerSql(Conditions conditions, String[] columns, Pager pager);

    BatchSqlHolder getBatchAddSql(String tableName, List<? extends Domain> datas);

    BatchSqlHolder getBatchUpdateSql(String tableName, List<? extends Domain> dataList);

    BatchSqlHolder getBatchUpdateSql(String tableName, String[] cols, List<? extends Domain> datas);

    String getGroupConcatSql(Conditions conditions, String attribute, String separator);

}
